<?php

namespace common\models\personnel;

use common\models\backend\Member;
use common\models\base\BaseModel;

/**
 * This is the model class for table "{{%by_project}}".
 *
 * @property int $id
 * @property int $status 状态
 * @property string $created_at 创建时间
 * @property string $updated_at 更新时间
 */
class ByProDetails extends BaseModel
{

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%by_pro_details}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['out_time','module','title','personnel_id'], 'required'],
            [['status', 'created_at', 'updated_at'], 'integer'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'module' => '模块',
            'title' => '主题',
            'cates.name' => "负责人",
            'personnel_id' => "负责人",
            'out_time' => "计划完成时间",
            'status' => '状态',
            'created_at' => '创建时间',
            'updated_at' => '修改时间',
        ];
    }
    public function getCate()
    {
        return $this->hasOne(Member::class, ['id' => 'member_id']);
    }
    public function getCates()
    {
        return $this->hasOne(Personnel::class, ['personnel_id' => 'personnel_id']);
    }
    public function getPro()
    {
        return $this->hasOne(ByProject::class, ['id' => 'pro_id']);
    }
}
